package com.sq.partner.manager.service;

import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.GatewaySubChannel;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.TradInsuPlanGroup;
import com.sq.partner.manager.util.Page;

/**
 * 合作伙伴机构配置
 * @author Kang Zhiqiang
 *
 */
public interface IGatewaySubChannelService {

	/**
	 * 根据subChannelCode或subChannelName模糊查询subChannel
	 * @param pageIndex
	 * @param subChannel
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public Page<GatewaySubChannel> querySubChannelByFuzzyCriteria(Integer pageIndex,GatewaySubChannel subChannel,GatewayUser user) throws Exception;

	/**
	 * 获取传入的用户的权限机构及其子机构对应的合作伙伴及其合作伙伴子机构
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public Page<GatewaySubChannel> queryChannelTreeByOneUser(GatewayUser user,Page<GatewaySubChannel> page) throws Exception;
	
	/**
	 * 根据传入的flag('success','update')新增或修改subChannel
	 * @param subChannel
	 * @param flag
	 * @return
	 * @throws Exception
	 */
	public boolean saveOrUpdateSubChannel(GatewaySubChannel subChannel,String flag) throws Exception;
	
	/**
	 * 根据传入的subChannel属性查询相应的List<GatewaySubChannel>
	 * @param subChannel
	 * @return
	 * @throws Exception
	 */
	public List<GatewaySubChannel> querySubChannelListBySubChannel(GatewaySubChannel subChannel) throws Exception;
	
	/**
	 * 虚拟删除subChannel（将subChannelCode对应的subChannel的status属性修改为“0”）
	 * @param subChannel
	 * @return
	 * @throws Exception
	 */
	public boolean delSubChannel(String subChannelCode) throws Exception;
	public boolean delSubChannel1(Map<String, String> map) throws Exception;
	
	public GatewaySubChannel querySubChannelInfoById(String subChannelCode) throws Exception;
	
	/***
	 * 根据合作伙伴，子机构代码查询
	 */
	public GatewaySubChannel querySubChannelInfoByCondition(Map<String, String> map) throws Exception;

/**
	 * 产品导出销售网点
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public  List<Map<String, Object>> impNlifeSub(Map<String, Object>map) throws Exception;

	public List<GatewaySubChannel> searchGatewaySubChannelsListByplanCode(Map<String, Object> maps)  throws Exception;

}
